import request from '@/utils/request'

// 创建采购订单
export function createPurchaseOrder(data) {
  return request({
    url: '/purchaseOrders',
    method: 'post',
    data
  })
}

// 获取采购订单列表
export function selectAllOrders(pageNum) {
  return request({
    url: '/purchaseOrders/selectList',
    method: 'get',
    params: { pageNum }
  })
}

// 获取订单详情
export function getOrderDetails(orderId) {
  return request({
    url: '/purchaseOrders',
    method: 'get',
    params: { orderId }
  })
}

// 更新订单状态
export function updateStatusByOrderId(orderId) {
  return request({
    url: '/purchaseOrders/updateStatusByOrderId',
    method: 'post',
    params: { orderId }
  })
} 